package com.deyuanyun.pic.web.timedtask;

/**
 * Created by xu on 2016/2/2.
 */

import com.deyuanyun.pic.common.exception.MyUncaughtExceptionHandler;

import java.util.concurrent.ThreadFactory;

/**用来替代ThreadFactory*/
public class HandlerThreadFactory implements ThreadFactory {
    @Override
    public Thread newThread(Runnable r) {
        Thread t = new Thread(r);
        t.setUncaughtExceptionHandler(new MyUncaughtExceptionHandler());
        return t;
    }
}
